Skip to content

Conversation

@markerikson
Copy link
Contributor

This PR:

  • Extracts the "override the Redux core Dispatch type" declaration to a separate extend-redux.d.ts types file
  • Updates the files list to include that in the published package
  • Updates the typetests to compare compilation behavior without and with that extended module imported

Notes per commit:

We previously merged a PR that would globally override the types
from the Redux core package and patch the Dispatch type to
always assume that the thunk middleware is installed.

However, that assumption is not always true, and globally
overriding types is a dangerous approach to have as a default.

This commit moves the global overrides into a separate types file,
which can now be imported as 'redux-thunk/extend-redux'. This
allows users to still opt in to that behavior if desired.

The typetest files have been updated to compare the behavior with
and without importing the override file.

We previously merged a PR that would globally override the types
from the Redux core package and patch the `Dispatch` type to
_always_ assume that the thunk middleware is installed.

However, that assumption is not always true, and globally
overriding types is a dangerous approach to have as a default.

This commit moves the global overrides into a separate types file,
which can now be imported as 'redux-thunk/extend-redux'.  This
allows users to still opt in to that behavior if desired.

The typetest files have been updated to compare the behavior with
and without importing the override file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants